#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 5010;

int f[N],n,ans[N];
ll x[N];
bool bl[N];

int gf(int x){return f[x] == x ? x : f[x] = gf(f[x]);}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in;
	for(int i = 1;i <= n;i++) x[i] = in;
	for(int i = 1;i <= n;i++) f[i] = i;
	for(int i = 1;i <= n;i++)
		for(int j = 1;j < i;j++)
			if(x[i] * x[j] > 0){
				ll tt = sqrt(x[i] * x[j]);
				if(tt * tt == x[i] * x[j]){
					int fx = gf(i),fy = gf(j);
					f[fx] = fy;
				}
			}
	for(int i = 1;i <= n;i++){
		int tt = 0; memset(bl,0,sizeof(bl));
		for(int j = i;j <= n;j++){
			if(x[j] == 0){
				ans[max(tt,1)]++;
			}
			else{
				if(!bl[gf(j)]) bl[gf(j)] = 1,tt++;
				ans[tt]++;
			}
		}
	}for(int i = 1;i <= n;i++) printf("%d%c",ans[i]," \n"[i==n]);
	return 0;
}

